package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/**
 * 字符流： java.io.Reader、Writer
 * 都是抽象类，是所有字符流的超类
 * 演示案例转换流
 */
public class OswDemo {
    public static void main(String[] args) throws IOException {
        //OutputStreamWriter
        FileOutputStream fos=new FileOutputStream("osw.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("你好，我是王小二");
        osw.write("诗人喔持，哎斯比");
        System.out.println("写出完毕");
        osw.close();






    }
}
